#pragma once

class CSize {
public:
    int width;
    int height;

    CSize() : width(0), height(0) {}
    CSize(int w, int h) : width(w), height(h) {}
    
    void setSize(int w, int h) { width = w; height = h; }
    
    bool isEmpty() const { return width == 0 && height == 0; }
    
    bool operator==(const CSize& other) const { return width == other.width && height == other.height; }
    
    bool operator!=(const CSize& other) const { return !(*this == other); }
    
    CSize operator+(const CSize& other) const { return CSize(width + other.width, height + other.height); }
    
    CSize operator-(const CSize& other) const { return CSize(width - other.width, height - other.height); }
    
    // overloading compound addition operator
    CSize& operator+=(const CSize& other) {
        width += other.width;
        height += other.height;
        return *this;
    }
    
    // overloading composite subtraction operator
    CSize& operator-=(const CSize& other) {
        width -= other.width;
        height -= other.height;
        return *this;
    }
};